
//
//  LDAudioResumePlayer.swift
//  DingDongZP
//
//  Created by LeMac on 16/12/31.
//  Copyright © 2016年 51ledian.com. All rights reserved.
//

#import <Foundation/Foundation.h>
@class LDAudioPlayer;

@protocol LDAudioPlayerDelegate <NSObject>

@optional

//刷新
- (void)playProgress:(LDAudioPlayer *)audioplayer Progress:(float)progress;

//当一首歌曲播放完成
- (void)playEnd:(LDAudioPlayer *)audioplayer;

//读取失败
- (void) playError:(LDAudioPlayer *)audioplayer;

@end


@interface LDAudioPlayer : NSObject


@property (nonatomic,copy) void(^playProgress)(LDAudioPlayer *,float);
@property (nonatomic,copy) void(^playEnd)(LDAudioPlayer *);
@property (nonatomic,copy) void(^playError)(LDAudioPlayer *);

//准备播放新的媒体源
@property (nonatomic,copy) void(^playNew)(LDAudioPlayer *);

@property(nonatomic,assign)id<LDAudioPlayerDelegate>delegate;
@property(nonatomic,assign)BOOL isPlaying;

+(LDAudioPlayer*)sharePlayer;
//播放
-(void)play;
-(void)pause;

-(void)seekToTime:(float)time;
//准备
-(void)setPrepareMusicUrl:(NSString*)urlStr;



@end
